<?php

namespace App\Jobs;

use App\Services\MailService;

class MailJob extends Job
{
    public $to;
    public $title;
    public $content;
    public $view;
    public $data;
    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($to, $title, $content, $view, $data)
    {
        $this->to = $to;
        $this->title = $title;
        $this->content = $content;
        $this->view = $view;
        $this->data = $data;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        MailService::send($this->to, $this->title, $this->content, $this->view, $this->data);
    }
}
